package com.web.lang;

import com.app.AppContext;
import com.web.model.WebPage;

public class LanguageConfig {
	
	private static final LanguageConfigBean config = AppContext.getBean(LanguageConfigBean.class);

	private static LanguagePopulator languagePopulator = new LanguagePopulator(config);
	
	public static Language getLanguage(){
		
		return config.getLanguage();
	}
	
	public static <T extends WebPage> void initCopies(Class<T> pageClass){
		
		languagePopulator.populateClass(pageClass);
	}

	public static void setLanguage(Language lang) {
		
		config.setLanguage(lang);
		
		languagePopulator = new LanguagePopulator(config);
	}
}
